package com.fenqing.leetcode.code.t1400_1500;

import com.fenqing.annotations.Execute;
import com.fenqing.core.Topic;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fenqing
 */
public class Topic1431 extends Topic {
    //
    /**
     * 构造器
     *
     * @param input1 输入1
     * @param input2 输入2
     */
    public Topic1431(String input1, String input2) {
        super(input1, input2);
    }

    @Execute
    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = 0;
        for (int candie : candies) {
            if (candie > max) {
                max = candie;
            }
        }
        List<Boolean> list = new ArrayList<>();
        for (int candie : candies) {
            list.add(candie + extraCandies >= max);
        }
        return list;
    }

    public static void main(String[] args) {
        List<Boolean> run = new Topic1431("[2,3,5,1,3]", "3").run();
        System.out.println(run);
    }

}
